package controller;

import model.entity.Entity;
import model.map.MapPoint;
import model.map.ViewMap;


public class ScrollMediator {

private class ScrollNorth implements Command{
		
		ScrollMediator m;
		
		public ScrollNorth(ScrollMediator m) {
			this.m = m;
		}
		public void execute() {
			m.scrollNorth();
		}
	}
	
	private class ScrollNE implements Command{
		
		ScrollMediator m;
		
		public ScrollNE(ScrollMediator m) {
			this.m = m;
		}

		@Override
		public void execute() {
			m.scrollNE();
			
		}

	}
	
	private class ScrollNW implements Command {

		ScrollMediator m;
		
		public ScrollNW(ScrollMediator m) {
			this.m = m;
		}

		@Override
		public void execute() {
			m.scrollNW();
			
		}

	}
	
	private class ScrollSouth implements Command{
		
		ScrollMediator m;
		
		public ScrollSouth(ScrollMediator m) {
			this.m = m;
		}

		public void execute() {
		 m.scrollSouth();
		}
	}
	
	private class ScrollSE implements Command {

		ScrollMediator m;
		
		public ScrollSE(ScrollMediator m) {
			this.m = m;
		}
		
		@Override
		public void execute() {
			m.scrollSE();

		}

	}
	
	private class ScrollSW implements Command {

		ScrollMediator m;
		
		public ScrollSW(ScrollMediator m) {
			this.m = m;
		}
		
		@Override
		public void execute() {
			m.scrollSW();

		}

	}

	private static ViewMap viewMap;
	
	public ScrollMediator(ViewMap viewMap) {
		KeyController.addScrollNorth(new ScrollNorth(this));
		KeyController.addScrollNortheast(new ScrollNE(this));
		KeyController.addScrollNorthwest(new ScrollNW(this));
		KeyController.addScrollSouth(new ScrollSouth(this));
		KeyController.addScrollSoutheast(new ScrollSE(this));
		KeyController.addScrollSouthwest(new ScrollSW(this));
	}
	
	private void scrollNorth() {
		viewMap.incrementScrollLocation(MapPoint.NORTH);
		
	}
	
	private void scrollNE() {
		viewMap.incrementScrollLocation(MapPoint.NORTHEAST);
		
	}
	private void scrollNW() {
		viewMap.incrementScrollLocation(MapPoint.NORTHWEST);
		
	}
	private void scrollSouth() {
		viewMap.incrementScrollLocation(MapPoint.SOUTH);
		
	}
	
	private void scrollSE() {
		viewMap.incrementScrollLocation(MapPoint.SOUTHEAST);
		
	}
	
	private void scrollSW() {
		viewMap.incrementScrollLocation(MapPoint.SOUTHWEST);
		
	}

	public static void commandMove(MapPoint direction) {
		
	}
	
	public static void clear() {
		viewMap.revertScroll();
	}
}
